package com.example.mall.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 支付记录表
 * </p>
 *
 * @author whale
 * @since 2025-05-09
 */
@TableName("tb_payment_records")
public class PaymentRecords extends Model<PaymentRecords> {

    private static final long serialVersionUID = 1L;

    /**
     * 支付记录唯一标识
     */
    @TableId("payment_id")
    private Long paymentId;
    /**
     * 订单ID（关联订单主表）
     */
    @TableField("order_id")
    private Long orderId;
    /**
     * 用户ID（关联用户表）
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 支付方式ID（关联支付方式表）
     */
    @TableField("method_id")
    private Long methodId;
    /**
     * 支付金额
     */
    private BigDecimal amount;
    /**
     * 第三方支付交易ID
     */
    @TableField("transaction_id")
    private String transactionId;
    /**
     * 支付状态（0：待支付，1：已支付，2：支付失败）
     */
    @TableField("payment_status")
    private Integer paymentStatus;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("update_date")
    private Date updateDate;

    public PaymentRecords() {
        this.paymentId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Long paymentId) {
        this.paymentId = paymentId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getMethodId() {
        return methodId;
    }

    public void setMethodId(Long methodId) {
        this.methodId = methodId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public Integer getPaymentStatus() {
        return paymentStatus;
    }

    public void setPaymentStatus(Integer paymentStatus) {
        this.paymentStatus = paymentStatus;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public String toString() {
        return "PaymentRecords{" +
        ", paymentId=" + paymentId +
        ", orderId=" + orderId +
        ", userId=" + userId +
        ", methodId=" + methodId +
        ", amount=" + amount +
        ", transactionId=" + transactionId +
        ", paymentStatus=" + paymentStatus +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
